package crivia.ecp.dcp.list.carry;

import java.util.List;

import crivia.c.a.KeyLink;
import crivia.c.carry.SubCarry;
import crivia.c.carry.ValueField;
import crivia.c.exception.CarryIOFail;
import crivia.ecp.dcp.common.DCPEditer;
import crivia.src.CI;

public class ListerDataFilter extends DCPEditer {
	
	static {
		
		if (! createTable(ListerDataFilter.class, true)){
			throw new CarryIOFail("Data Base Table Create Fail.");
		}
		
	}
	
	public static void main(String[] args) {
		CI.refreshDBI(ListerDataFilter.class);
		CI.refreshFields(ListerDataFilter.class);
//		System.out.println(ListerDataFilter.createTableSQLServer(ListerDataFilter.class));
	}
	
	public enum InjectType {
		Equals , Like , In , DayRange
		;
		public static InjectType k2v(String k){
			try {
				return InjectType.valueOf(k);
			} catch (Exception e) {
				return Equals;
			}
		}
	}

	@Override
	public ValueField primaryKey() {
		return ValueField.c2d("id");
	}

	@Override
	public String tableName() {
		return "Crivia_DCP_PM_ListerDtFlt";
	}

	@Override
	public void keyLinks(List<KeyLink> keyLinks) {
		keyLinks.add(SubCarry.c2d("lister", DCPLister.class));
		keyLinks.add(ValueField.c2d("lctX",int.class));
		keyLinks.add(ValueField.c2d("lctY",int.class));
		keyLinks.add(ValueField.c2d("injectType"));
		super.keyLinks(keyLinks);
	}


	
	
	
	
	
	
	

	
	
	
	
	//XXX DBI Begin.
	public enum Keys{
		lister("lister","lister")
		,lctX("lctX","lctX")
		,lctY("lctY","lctY")
		,injectType("injectType","injectType")
		,title("title","title")
		,key("key","key_")
		,initValue("initValue","initValue")
		,requirdString("requirdString","requirdString")
		,requirdStringLevel("requirdStringLevel","requirdStringLevel")
		,type("type","type")
		,textareaHeight("textareaHeight","textareaHeight")
		,textareaWidth("textareaWidth","textareaWidth")
		,isHTMLEditer("isHTMLEditer","isHTMLEditer")
		,selectDataType("selectDataType","selectDataType")
		,selectData("selectData","selectData")
		,browserURL("browserURL","browserURL")
		,browserSystemKey("browserSystemKey","browserSystemKey")
		,browserRelationer("browserRelationer","browserRelationer")
		;
		private String _dbKey;
		private String _key;
		Keys(String key,String dbKey){_key=key;_dbKey=dbKey;}
		@Override
		public String toString(){return _dbKey;}
		/**  <b>Key</b> in <b>Carry</b>. */
		public String key(){return _key;}
	}
	private static crivia.ecp.dcp.list.carry.ListerDataFilter dbi;
	public synchronized static void initDBI(){if(null!=dbi)return;dbi=new crivia.ecp.dcp.list.carry.ListerDataFilter();}
	/**  <b>DB Table</b> of <b>Carry</b>. */
	public static String table(){initDBI();return dbi.tableName();}
	/**  <b>Primary Key</b> of <b>Carry</b>. */
	public static String pk(){initDBI();return dbi.pk4db();}
	/**  <b>Relation SQL</b> of <b>Relation Key</b>. */
	public static String rSQL(crivia.ecp.dcp.list.carry.ListerDataFilter.Keys k,String t){initDBI();return dbi.relationSQL(k.key(),t);}
	//XXX DBI End.



	

	

	

	

	// XXX Fields Begin.



	/** ...(Miss Tip Text.) */
	private java.lang.String id;
	/** Getter for ...(Miss Tip Text.) */
	public java.lang.String getId(){
		return id;
	}
	/** Setter for ...(Miss Tip Text.) */
	public crivia.ecp.dcp.list.carry.ListerDataFilter setId(java.lang.String id){
		this.id = id;
		return this;
	}


	/** ...(Miss Tip Text.) */
	private crivia.ecp.dcp.list.carry.DCPLister lister;
	/** Getter for ...(Miss Tip Text.) */
	public crivia.ecp.dcp.list.carry.DCPLister getLister(){
		if (null == lister){
			lister = new crivia.ecp.dcp.list.carry.DCPLister();
		}
		return lister;
	}
	/** Setter for ...(Miss Tip Text.) */
	public crivia.ecp.dcp.list.carry.ListerDataFilter setLister(crivia.ecp.dcp.list.carry.DCPLister lister){
		this.lister = lister;
		return this;
	}


	/** ...(Miss Tip Text.) */
	private int lctX;
	/** Getter for ...(Miss Tip Text.) */
	public int getLctX(){
		return lctX;
	}
	/** Setter for ...(Miss Tip Text.) */
	public crivia.ecp.dcp.list.carry.ListerDataFilter setLctX(int lctX){
		this.lctX = lctX;
		return this;
	}


	/** ...(Miss Tip Text.) */
	private int lctY;
	/** Getter for ...(Miss Tip Text.) */
	public int getLctY(){
		return lctY;
	}
	/** Setter for ...(Miss Tip Text.) */
	public crivia.ecp.dcp.list.carry.ListerDataFilter setLctY(int lctY){
		this.lctY = lctY;
		return this;
	}


	/** ...(Miss Tip Text.) */
	private java.lang.String injectType;
	/** Getter for ...(Miss Tip Text.) */
	public java.lang.String getInjectType(){
		return injectType;
	}
	/** Setter for ...(Miss Tip Text.) */
	public crivia.ecp.dcp.list.carry.ListerDataFilter setInjectType(java.lang.String injectType){
		this.injectType = injectType;
		return this;
	}


	// XXX Fields End.

}